<template>
	<view class="minTcInfo">
		<view class="imgbox">
			<cm-image :src="infor.selfAvatar || infor.avatar"/>
		</view>
		<view class="top-con">
			<view class="name">
				{{infor.name || infor.nickname}}
				<text class="bzhi">专家</text>
				<template v-if="price || price==0">
					<view class="price" v-if="price">¥<text class="num">{{price}}</text></view>
					<view class="price" v-else>免费</view>
				</template>
			</view>
			<view class="intro">
				{{infor.company}} | {{infor.industry}} | {{infor.jobs}}
			</view>
		</view>
	</view>
</template>

<script>
	import {defineComponent,reactive,toRefs,onMounted,getCurrentInstance,computed} from 'vue'
	import {onLoad,onShow} from '@dcloudio/uni-app'
	import { useStore } from 'vuex'
	import cmImage from "@/components/cmImage/index.vue"
	export default defineComponent({
		components:{
			cmImage
		},
		props:{
			infor:Object,
			price:'' // 专家回复是需要显示价格
		},
		setup(props,context) {
			const store = useStore()
			const {proxy} = getCurrentInstance()
			
			const state = reactive({
				userInfo:computed(()=>store.state.base.userInfo),
			})
			
			onMounted(()=>{
				
			})
			

			
			return {
				...toRefs(state),
			}
		}
	})
</script>

<style lang="scss" scoped>
	.minTcInfo{
		display: flex;
		box-sizing: border-box;
		width: 100%;
		.imgbox{
			width: 100rpx;
			height: 100rpx;
			border-radius: 50%;
			overflow: hidden;
			flex-shrink: 0;
		}
		.top-con{
			box-sizing: border-box;
			padding: 0 0 0 20rpx;
			flex: 1;
			flex-shrink: 0;
			height: 0;
			.name{
				display: flex;
				height: 50rpx;
				align-items: center;
				font-size: 30rpx;
				font-weight: bold;
				padding: 0;
				margin: 0;
				.bzhi{
					flex-shrink: 0;
					background-color: #ff1120;
					font-size: 22rpx;
					color: #fff;
					padding: 0 8rpx;
					border-radius: 5rpx;
					margin: 0 0 0 10rpx;
				}
				.price{
					display: flex;
					align-items: center;
					justify-content: flex-end;
					flex: 1;
					flex-shrink: 0;
					color: #999;
					font-size: 26rpx;
					font-weight: normal;
					padding: 0 20rpx 0 0;
					.num{
						font-weight: bold;
						font-size: 36rpx;
						color: #ff1120;
						padding: 0 0 0 10rpx;
					}
				}
			}
			.intro{
				color: #999;
				font-size: 28rpx;
				height: 50rpx;
				line-height: 50rpx;
				width: 100%;
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
				word-break: break-all;
			}
		}
	}
</style>
